package org.msd.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.msd.dao.ZoomDaO;
import org.msd.model.Commodity;
import org.msd.service.iml.ZoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class ZoomSeRvice implements ZoomService {
    @Autowired
    private ZoomDaO zoomDaO;
    @Override
    public PageInfo<Commodity> RoomQuer(Integer pageNum, Integer pageSize) {

        PageHelper.startPage(pageNum, pageSize);
        List<Commodity> commodityList= zoomDaO.RoomQuer();
        PageInfo<Commodity> pageInfo=new PageInfo<>(commodityList);//将分页的数据进行封装看v发
        return pageInfo;
    }

    @Override
    public List<Commodity> RoomQuer() {
        return zoomDaO.RoomQuer();
    }

    @Override
    public List<Commodity> Fuzzyquery(String person) {
        return zoomDaO.Fuzzyquery(person);
    }

    @Override
    public Commodity GETProductid(int commodityid) {
        return zoomDaO.GETProductid(commodityid);
    }

    @Override
    public int Changestatus(int commodityid, String person) {
        return zoomDaO.Changestatus(commodityid,person);
    }

    @Override
    public Commodity Checkrent(int commodityid) {
        return zoomDaO.Checkrent(commodityid);
    }

    @Override
    public List<Commodity> getlist(int start, int count) {
        return zoomDaO.getlist(start, count);
    }

    @Override
    public Integer getTotal() {
        return zoomDaO.getTotal();
    }

    @Override
    public int deleteZoom(int commodityid) {
        return zoomDaO.deleteZoom(commodityid);
    }


}
